/**
 * Created by Administrator on 10/11/2016.
 */
public class Student {
    private String nameAndID;
    private int chinese;
    private int math;
    private int english;
    private int physics;
    private int chemistry;
    private int biology;
    private int sum;    //总分

    public Student(String g_nameAndID)
    {
        this.nameAndID=g_nameAndID;
        this.sum=0;
    }

    public void setChinese(int g_chinese)
    {
        this.chinese=g_chinese;
    }
    public int getChinese()
    {
        return this.chinese;
    }

    public void setMath(int g_math)
    {
        this.math=g_math;
    }
    public int getMath()
    {
        return this.math;
    }

    public void setEnglish(int g_english)
    {
        this.english=g_english;
    }
    public int getEnglish()
    {
        return this.english;
    }

    public void setPhysics(int g_physics)
    {
        this.physics=g_physics;
    }
    public int getPhysics()
    {
        return this.physics;
    }

    public void setChemistry(int g_chemistry)
    {
        this.chemistry=g_chemistry;
    }
    public int getChemistry()
    {
        return this.chemistry;
    }

    public void setBiology(int g_biology)
    {
        this.biology=g_biology;
    }
    public int getBiology()
    {
        return this.biology;
    }

    public String getNameAndID()
    {
        return this.nameAndID;
    }

    public void countSum()
    {
        this.sum+= this.chinese+this.math+this.english+this.physics+this.chemistry+this.biology;
    }
    public int getSum()
    {
        return this.sum;
    }

    public int compare(Student B)   //比较两个学生的总成绩
    {
        if (this.sum > B.sum)
            return 1;
        else if (this.sum < B.sum)
            return -1;
        else
            return 0;
    }
}
